/* 页面头部样式 - 移动端优化 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--card-background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    z-index: 1;
}

.header-content {
    flex: 1;
    z-index: 2;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs) 0;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-md) 0;
    font-weight: 500;
}

/* 日志统计样式 */
.log-stats {
    display: flex;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: var(--spacing-md);
    z-index: 2;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-icon {
    font-size: 16px;
}

/* 搜索和过滤栏样式 */
.search-filter-bar {
    background: var(--card-background);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

.search-box {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.search-input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-md) 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 16px;
    background: var(--card-background);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.filter-tabs {
    display: flex;
    gap: var(--spacing-sm);
    overflow-x: auto;
    padding-bottom: var(--spacing-xs);
    -webkit-overflow-scrolling: touch;
}

.filter-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--hover-background);
    color: var(--text-secondary);
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-tab:hover {
    background: rgba(46, 204, 113, 0.15);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-light);
}

/* 日志日期标题样式 */
.log-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: var(--spacing-lg) 0 var(--spacing-sm);
    padding-left: var(--spacing-md);
    position: relative;
}

.log-date::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.log-date:first-child {
    margin-top: 0;
}

/* 日志项样式 - 移动端优化 */
.log-item {
    background: var(--card-background);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.log-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.log-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    background: var(--card-background-hover);
}

.log-item:hover::before {
    opacity: 1;
}

/* 日志头部样式 */
.log-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    align-items: flex-start;
    gap: var(--spacing-sm);
}

/* 植物名称样式 - 移动端优化 */
.log-plant {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    letter-spacing: -0.3px;
}

/* 日志时间样式 - 移动端优化 */
.log-time {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 日志内容样式 */
.log-content {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 500;
}

/* 添加日志按钮样式 */
.add-log-btn {
    position: fixed;
    right: var(--spacing-lg);
    bottom: 72px; /* 避开底部导航 */
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.3);
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 90;
}

.add-log-btn:hover {
    transform: scale(1.1);
    background-color: var(--primary-light);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.add-log-btn:active {
    transform: scale(0.95);
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: var(--spacing-md);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--card-background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-hover);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-content {
    padding: var(--spacing-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: var(--hover-background);
    color: var(--text-primary);
}

/* 表单样式 */
.log-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 16px;
    background: var(--card-background);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

/* 照片上传样式 */
.photo-input {
    padding: var(--spacing-md);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    background: var(--hover-background);
    cursor: pointer;
    transition: all 0.3s ease;
}

.photo-input:hover {
    border-color: var(--primary-color);
    background: rgba(46, 204, 113, 0.05);
}

.photo-preview {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
}

.photo-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-photo {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-primary);
    color: white;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-light);
}

/* 日志照片样式 */
.log-photos {
    display: flex;
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
    flex-wrap: wrap;
}

.log-photo {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.log-photo:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

/* 照片查看模态框 */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--spacing-lg);
}

.photo-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo-modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-hover);
}

.photo-modal-name {
    color: white;
    font-size: 14px;
    margin-top: var(--spacing-md);
    text-align: center;
}

.photo-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.photo-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.form-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

/* 日志元数据样式 */
.log-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
}

.log-type {
    font-size: 12px;
    color: var(--primary-color);
    background: rgba(46, 204, 113, 0.1);
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
}

.log-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
    opacity: 0.6;
}

.btn-icon:hover {
    background-color: var(--hover-background);
    opacity: 1;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-lg);
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-desc {
    font-size: 14px;
    margin-bottom: var(--spacing-lg);
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--text-primary);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
}

/* 响应式调整 */
@media (max-width: 375px) {
    .add-log-btn {
        right: var(--spacing-md);
        bottom: 68px;
    }
    
    .modal-container {
        margin: var(--spacing-sm);
        max-height: 95vh;
    }
    
    .modal-content {
        padding: var(--spacing-md);
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}